package Netzwerkprogrammierung.g2.RMI;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class RMIClient {

	public static void main(String[] args) throws MalformedURLException, RemoteException, NotBoundException {

		Registry registry = LocateRegistry.getRegistry();
		RMIRemoteInterface multiplyer2 = 
				(RMIRemoteInterface) registry.lookup("Multiplyer");
		
		RMIRemoteInterface multiplyer = 
				(RMIRemoteInterface) Naming.lookup("//127.0.0.1/Multiplyer");
		
		System.out.println(multiplyer.multiply(2, 5));
		System.out.println(multiplyer2.multiply(2, 5));

	}

}
